package com.xmut.mall.auth.controller;

import com.xmut.mall.auth.service.LoginService;
import com.xmut.mall.auth.utils.RespBean;
import com.xmut.mall.auth.vo.LoginVo;
import com.xmut.mall.auth.vo.SmsLoginVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {

    @Autowired
    private LoginService loginService;


    /**
     * 普通登录
     * @param vo
     * @return
     */
    @PostMapping("/login")
    public RespBean login(@RequestBody LoginVo vo){
        return loginService.login(vo);
    }

    /**
     * 短信登录
     * @param vo
     * @return
     */
    @PostMapping("/smsLogin")
    public RespBean smsLogin(@RequestBody SmsLoginVo vo){
        return loginService.smsLogin(vo);
    }

    /**
     * 管理端登录
     * @param vo
     * @return
     */
    @PostMapping("/managerLogin")
    public RespBean managerLogin(@RequestBody LoginVo vo){
        return loginService.managerLogin(vo);
    }

    /**
     * 商铺端 卖家登录
     * @param vo
     * @return
     */
    @PostMapping("/sellerLogin")
    public RespBean sellerLogin(@RequestBody LoginVo vo){
        return loginService.sellerLogin(vo);
    }
}
